package School;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 34255
 * Date: 2024-10-25
 * Time: 8:42
 */
public class Student extends E implements inte_F{

    private int dutyNum;
    private int lostNum;
    private int lateNum;

    public Student(String name, int serviceYears, double salary, double bonus, int dutyNum, int lostNum, int lateNum) {
        super(name, serviceYears, salary, bonus);
        this.dutyNum = dutyNum;
        this.lostNum = lostNum;
        this.lateNum = lateNum;
    }

    public int getDutyNum() {
        return dutyNum;
    }

    public void setDutyNum(int dutyNum) {
        this.dutyNum = dutyNum;
    }

    public int getLostNum() {
        return lostNum;
    }

    public void setLostNum(int lostNum) {
        this.lostNum = lostNum;
    }

    public int getLateNum() {
        return lateNum;
    }

    public void setLateNum(int lateNum) {
        this.lateNum = lateNum;
    }

    public int sum_P(){
        return 2500 + 50 * dutyNum - 100 * lateNum - 300 * lostNum;
    }

    public int sum_S(int age_W){
        if(age_W > 20){
            return 5000;
        }else if(age_W > 10){
            return 4000;
        }else{
            return 3000;
        }
    }

    @Override
    public int sum() {
        return sum_P() + sum_S(getServiceYears());
    }
}
